{include file="common/header" /}
<body>
<head>
{include file="common/top" /}
</head>
<!--广告幻灯片样式-->
   	<div id="slideBox" class="slideBox">
			<div class="hd">
				<ul class="smallUl"></ul>
			</div>
			<div class="bd">	
				<ul>
					{volist name="banners" id="vo"}
					<li><a href=""><div style="background:url({$vo.src}) no-repeat; background-position:center; width:100%; height:450px;"></div></a></li>
					{/volist}
				</ul>	
			</div>
			<!-- 下面是前/后按钮-->
			<a class="prev" href="javascript:void(0)"></a>
			<a class="next" href="javascript:void(0)"></a>

		</div>
		<script type="text/javascript">
		jQuery(".slideBox").slide({titCell:".hd ul",mainCell:".bd ul",autoPlay:true,autoPage:true});
		</script>
 </div>

<!--内容样式-->
<div id="mian">
 <div class="clearfix marginbottom">
 <!--产品分类样式-->
  <div class="Menu_style" id="allSortOuterbox">
   <div class="title_name"><em></em>所有商品分类</div>
   <div class="content hd_allsort_out_box_new">
    <ul class="Menu_list">
    {volist name="types" id="vo"}
      <li class="name">
		<div class="Menu_name"><a href="{:url('goods/index',['id'=>$vo.id])}" >{$vo.name}</a> <span>&gt;</span></div>
		<div class="menv_Detail">
		 <div class="cat_pannel clearfix">
		   <div class="hd_sort_list">
		    <dl class="clearfix" data-tpc="1">
			 <dt><a href="{:url('goods/index',['id'=>$vo.id])}">{$vo.name}<i>></i></a></dt>
			 <dd>
			 	{volist name="childType" id="child"}
			 	{if $vo.id == $child.parent_id} 
			 	<a href="{:url('goods/getgoodsbycategory',['cid'=>$vo.id])}">{$child.name}</a>
			 	{/if}
			 	{/volist}
			 </dd> 
			</dl>
		   </div><div class="Brands">
		  </div>
		  </div>
		  <!--品牌-->		  
		</div>		 
		</li>
		{/volist}
    </ul>
   </div>
  </div>
  <script>$("#allSortOuterbox").slide({ titCell:".Menu_list li",mainCell:".menv_Detail",	});</script>
  <!--产品栏切换-->
  <div class="product_list left">
  		<div class="slideGroup">
			<div class="parHd">
				<ul><li>新品上市</li><li>超值特惠</li><li>本期团购</li><li>产品精选</li><li>抢先一步</li></ul>
			</div>
			<div class="parBd">
			<div class="slideBoxs">
				<a class="sPrev" href="javascript:void(0)"></a>
				<ul>
					{volist name="new" id="vo"}
					<li>
						<div class="pic"><a href="{:url('goods/goods_detail',['id'=>$vo.id])}" target="_blank"><img src="{$vo.picture}" /></a></div>
						<div class="title">
                        <a href="{:url('goods/goods_detail',['id'=>$vo.id])}" target="_blank" class="name">{$vo.brand} {$vo.gname}</a>
                        <h3><b>￥</b>{$vo.price}</h3>
                        </div>
					</li>
					{/volist}
				</ul>
				<a class="sNext" href="javascript:void(0)"></a>
			</div><!-- slideBox End -->
		</div><!-- parBd End -->
		</div>
        <script type="text/javascript">
			/* 内层图片无缝滚动 */
			jQuery(".slideGroup .slideBoxs").slide({ mainCell:"ul",vis:4,prevCell:".sPrev",nextCell:".sNext",effect:"leftMarquee",interTime:50,autoPlay:true,trigger:"click"});
			/* 外层tab切换 */
			jQuery(".slideGroup").slide({titCell:".parHd li",mainCell:".parBd"});
		</script>
        <!--特惠品-->
        <div class="Ads_style">
			{volist name="discount" id="vo"}
        	<a href="{:url('goods/goods_detail',['id'=>$vo.id])}"><img src="{$vo.picture}" title="{$vo.gname}"  width="318"/></a>
        	{/volist}
        </div>
  </div>
 </div>
 <!--板块栏目样式-->
 <div class="clearfix Plate_style">
  <div class="Plate_column Plate_column_left">
    <div class="Plate_name">
    <h2>饮品杯系列</h2>
    <div class="Sort_link">
    {volist name="drank" id="vo"}
      <a href="{:url('goods/getgoodsbycategory',['cid'=>$vo.id])}" class="name">{$vo.name}</a>
    {/volist}
    </div>
    <a href="{:url('goods/index',['id'=>3])}" class="Plate_link"> <img src="__STATIC__/index/images/bk_img_14.png" /></a>
    </div>
    <div class="Plate_product">
    <ul id="lists">
        {volist name="drank_goods" id="vo"}
       <li class="product_display">
        <a href="javascript:void(0)" attr-id="{$vo.id}" class="Collect"><em></em>收藏</a>
        <a href="{:url('goods/goods_detail',['id'=>$vo.id])}" class="img_link"><img src="{$vo.picture}"  width="140" height="140"/></a>
        <a href="{:url('goods/goods_detail',['id'=>$vo.id])}" class="name">{$vo.gname}</a>
        <h3><b>￥</b>{$vo.price}</h3>
        <div class="Detailed">
  	       <div class="content">
  		      <p class="center"><a href="{:url('goods/goods_detail',['id'=>$vo.id])}" class="Buy_btn">点击查看</a></p>
  		     </div>
  	   </div>
       </li>
       {/volist}
    </ul>
    </div>
  </div>
  <!--板块名称-->
    <div class="Plate_column Plate_column_right">
    <div class="Plate_name">
    <h2>PET系列</h2>
    <div class="Sort_link">
      {volist name="pet" id="vo"}
      <a href="{:url('goods/getgoodsbycategory',['cid'=>$vo.id])}" class="name">{$vo.name}</a>
      {/volist}
    </div>
    <a href="{:url('goods/index',['id'=>2])}" class="Plate_link"> <img src="__STATIC__/index/images/bk_img_19.png" /></a>
   
    </div>
    <div class="Plate_product">
    <ul id="lists">
      {volist name="pet_goods" id="vo"}
       <li class="product_display">
        <a href="javascript:void(0)" attr-id="{$vo.id}" class="Collect"><em></em>收藏</a>
        <a href="{:url('goods/goods_detail',['id'=>$vo.id])}" class="img_link"><img src="{$vo.picture}"  width="140" height="140"/></a>
        <a href="{:url('goods/goods_detail',['id'=>$vo.id])}" class="name">{$vo.gname}</a>
        <h3><b>￥</b>{$vo.price}</h3>
        <div class="Detailed">
           <div class="content">
            <p class="center"><a href="{:url('goods/goods_detail',['id'=>$vo.id])}" class="Buy_btn" >点击查看</a></p>
           </div>
       </div>
       </li>
       {/volist}
    </ul>
    </div>
  </div>
   <div class="Plate_column Plate_column_left">
    <div class="Plate_name">
    <h2>纸杯系列</h2>
    <div class="Sort_link">
      {volist name="zhibei" id="vo"}
      <a href="{:url('goods/getgoodsbycategory',['cid'=>$vo.id])}" class="name">{$vo.name}</a>
      {/volist}
    </div>
    <a href="{:url('goods/index',['id'=>1])}" class="Plate_link"> <img src="__STATIC__/index/images/bk_img_22.png" /></a>
   
    </div>
    <div class="Plate_product">
    <ul id="lists">
     {volist name="zhibei_goods" id="vo"}
       <li class="product_display">
        <a href="javascript:void(0)" attr-id="{$vo.id}" class="Collect"><em></em>收藏</a>
        <a href="{:url('goods/goods_detail',['id'=>$vo.id])}" class="img_link"><img src="{$vo.picture}"  width="140" height="140"/></a>
        <a href="{:url('goods/goods_detail',['id'=>$vo.id])}" class="name">{$vo.gname}</a>
        <h3><b>￥</b>{$vo.price}</h3>
        <div class="Detailed">
           <div class="content">
            <p class="center"><a href="{:url('goods/goods_detail',['id'=>$vo.id])}" class="Buy_btn" >点击查看</a></p>
           </div>
       </div>
       </li>
       {/volist}
    </ul>
    </div>
  </div>
  <!--板块名称-->
    <div class="Plate_column Plate_column_right">
    <div class="Plate_name">
    <h2>生活用纸</h2>
    <div class="Sort_link">
      {volist name="paper" id="vo"}
      <a href="{:url('goods/getgoodsbycategory',['cid'=>$vo.id])}" class="name">{$vo.name}</a>
      {/volist}
    </div>
    <a href="{:url('goods/index',['id'=>7])}" class="Plate_link"> <img src="__STATIC__/index/images/bk_img_14.png" /></a>
   
    </div>
    <div class="Plate_product">
    <ul id="lists">
     {volist name="paper_goods" id="vo"}
       <li class="product_display">
        <a href="javascript:void(0)" attr-id="{$vo.id}" class="Collect"><em></em>收藏</a>
        <a href="{:url('goods/goods_detail',['id'=>$vo.id])}" class="img_link"><img src="{$vo.picture}"  width="140" height="140"/></a>
        <a href="{:url('goods/goods_detail',['id'=>$vo.id])}" class="name">{$vo.gname}</a>
        <h3><b>￥</b>{$vo.price}</h3>
        <div class="Detailed">
           <div class="content">
            <p class="center"><a href="{:url('goods/goods_detail',['id'=>$vo.id])}" class="Buy_btn" >点击查看</a></p>
           </div>
       </div>
       </li>
       {/volist}
    </ul>
    </div>
  </div>
 </div>
<script>
 $(function(){
    $('.product_display .Collect').click(function(){
      {if $Think.session.user['id']}
        uid = {$Think.session.user['id']};
      {else}
        $('#login').show();
        return;
      {/if}
      id = $(this).attr('attr-id');
      url = "{:url('goods/collect')}";
      data = {'id':id};
      $.post(url,data,function(result){
        if (result.status == 1) {
          data = result.data;
          $('.collection .shops img').attr('src',data['picture']);
          $('.collection .gname').html(data['gname']);
          $('.collection .shops span').html(data['price']);
          $('.collection input:hidden').val(data.id);
          $('.collection').show();
        }
      },'json')
    });

    $('.close_login img').click(function(){
      $('.login').hide();
    });

    $('.login_btn input').click(function(){
        var username = $('#field_user').val();
        var password = $('#field_pwd').val();
        var url = "{:url('user/ajaxLogin')}";
        var data = {'username':username,'password':password};
        $.post(url,data,function(result){
            if (result.code == 1) {
                location.href=result.data;
            }else if(result.code == 0){
                alert(result.msg);
                return;
            }
        },'json');
    });

    $('.cls_collect img').click(function(){
      $('.collection').hide();
    });

    $('.btn_ok button').click(function(){
      {if $Think.session.user['id']}
      uid = {$Think.session.user['id']};
      {else}
      uid = 0;
      {/if}
      gid = $('.collection input:hidden').val();
      picture = $('.collection .shops img').attr('src');
      gname = $('.collection .gname').html();
      price = $('.collection .shops span').html();
      data = {
        'uid' : uid,
        'gid' : gid,
        'picture' : picture,
        'gname' : gname,
        'price' : price,
      };
      url = "{:url('goods/collection_add')}";
      $.post(url,data,function(result){
        console.log(result);
          if (result.code == 1) {
            $('.collection div:first').removeClass('tips').addClass('add_success').html('添加成功');
          } else if(result.code == 0){
            alert(result.msg);
          }
      });
    });
 });
</script>
 <div class="collection">
   <div class="tips">确认收藏该宝贝？</div>
   <div class="cls_collect"><img src="__STATIC__/index/images/close2.png" alt="" title="关闭"></div>
   <div class="shops">
     <a href=""><img src="" alt="" width="100" height="100"></a>
     <a class="gname" href=""></a><br><br>
     ￥ <span></span>
   </div>
   <input type="hidden" value="">
   <div class="btn_ok"><button>确定</button></div>
 </div>

 <div class="login" id="login">
    <div class="title"><h1>账号登录</h1><div class="close_login"><img src="__STATIC__/index/images/close2.png" title="关闭" alt="" /></div></div>
    <div class="pwd_login">
        <h1>密码登录</h1>
    </div>
    <div class="login_form">
        <form action="">
            <div class="field userfield">
                <img src="__STATIC__/index/images/l_03.png" alt="" />
                <input id="field_user" class="form_ipt" name="username" type="text" vlaue="" placeholder="用户名/邮箱/手机号" />
            </div>
            <div class="field pwdfield">
                <img src="__STATIC__/index/images/l_06.png" alt="" />
                <input id="field_pwd" class="form_ipt" name="password" type="password" value="" />
            </div>
            <div class="login_btn">
                <input type="button" value="登录" />
            </div>
        </form>
        <div class="other">
            <span><a href="{:url('user/register')}" target="_blank">免费注册</a></span>
            <span><a href="">忘记密码</a></span>
        </div>
    </div>
</div>
 <!--友情链接-->
 <div class="link_style clearfix">
 <div class="title">友情链接</div>
 <div class="link_name">
 </div>
 </div>
</div>
{include file="common/footer" /}
</body>
</html>
